home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2000 March / MacHome CD (March 2000).iso / mac / EarthLink Network / TA Install / Registration & Utilities / Registration & Utilities.rsrc / TEXT_410_Modem CCL.txt < prev    next >
Text File  |  1999-04-29  |  10KB  |  521 lines

  1. !    EarthLink Network Script
  2. !
  3. !    Author:            Kris Kreutzman
  4. !    Modified by:    Herb Hrowal
  5. !
  6. !    This script was automatically generated by EarthLink TotalAccess‚Ñ¢
  7. !    for ¬ßmodemname¬ß.
  8. !
  9. !    Copyright:    ¬© 1991-1998 Apple Computer, Inc.    All Rights Reserved.
  10. !
  11. !    revision history:
  12. !        v2.1    as shipped with the ARA 2.1
  13. !
  14. !  'mlts' resource info for this modem:
  15. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  16. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  17. !    byte 3 == 40 -> max number of chars in varstr 7
  18. !    byte 4 == 40 -> max number of chars in varstr 8
  19. !    byte 5 == 40 -> max number of chars in varstr 9
  20. !    
  21. @ORIGINATE
  22. @ANSWER
  23. !
  24. ! ---- Initial modem setup ----
  25. !
  26. ! Set serial port speed depending upon the compression flag
  27. !    A higher rate with compression on to handle expanded data from the modem
  28. !    A lower rate closer to the DCE when compression is off
  29. ifstr 5 1 "0"
  30. serreset ¬ßportspeed¬ß, 0, 8, 1
  31. jump 2
  32. !
  33. @LABEL 1
  34. serreset ¬ßportspeed¬ß, 0, 8, 1
  35. !
  36. @LABEL 2
  37. hsreset 0 0 0 0 0 0
  38. settries 0
  39. !
  40. ! Get the modem's attention
  41. !
  42. matchclr
  43. matchstr 1 3 "OK\13\10"
  44. write "AT\13"
  45. matchread 30
  46. !
  47. @LABEL 3
  48. !
  49. ! Setup the modem for the following:
  50. !   Reset to factory settings
  51. !   Standard compression/reliablity
  52. !   Lock serial port speed
  53. !   Serial port hardware handshaking, turn off software handshaking
  54. !   Verbose responces and compression/protocol results
  55. !   CONNECT returns DCE speed
  56. !   Turn off answering
  57. !   Reset or return to command mode on DTR toggle (optional)
  58. !
  59. matchclr
  60. matchstr 1 4   "OK\13\10"
  61. matchstr 2 101 "ERROR\13\10"
  62. write "¬ßinitstring¬ß\13"
  63. matchread 30
  64. inctries
  65. iftries 3 101
  66. !
  67. ! Reset the Modem on setup failure
  68. !
  69. DTRClear
  70. pause 5
  71. DTRSet
  72. flush
  73. jump 3
  74. !
  75. !
  76. @LABEL 4
  77. ! Varstring 4 , reliable link protocol:
  78. !    = 0, handled by computer (ARAP)
  79. !    = 1, handled by modem (PPP)
  80. !    = 2, MNP10 protocol (Cellular protocol, no longer supported)
  81. ifstr 4 5 "1"
  82. ifstr 4 5 "2"
  83. !
  84. ! Varstring 4 == 0, turn off reliable link protocol in modem (ARAP)
  85. matchclr
  86. matchstr 1 9 "OK\13\10"
  87. write "AT\13"
  88. matchread 30
  89. jump 101
  90. !
  91. !
  92. @LABEL 5
  93. ! Varstring 5, compression protocol:
  94. !    = 0, handled by computer 
  95. !    = 1, handled by modem
  96. ifstr 5 9 "1"
  97. !
  98. ! Varstring 5 == 0, turn off compression protocol in modem.
  99. matchclr
  100. matchstr 1 9 "OK\13\10"
  101. write "AT\13"
  102. matchread 30
  103. jump 101
  104. !
  105. !
  106. @LABEL 9
  107. ! Varstring 2, modem speaker:
  108. !    = 0, speaker off
  109. !    = 1, speaker on
  110. ifstr 2 13 "1"
  111. pause 5
  112. matchclr
  113. matchstr 1 13 "OK\13\10"
  114. write "ATM0\13"
  115. matchread 30
  116. jump 101
  117. !
  118. ! Modem ready, wait for a call or originate a call
  119. !
  120. @LABEL 13
  121. ifANSWER 32
  122. !
  123. !
  124. ! ---- Originating a call ----
  125. !
  126. ! Varstring 6, dialing mode:
  127. !    = 0, normal dialing
  128. !    = 1, blind dialing
  129. !    = 2, manual dialing
  130. ifstr 6 17 "1"
  131. ifstr 6 15 "2"
  132. jump 19
  133. !
  134. @LABEL 15
  135. ! Display ASK dialog with message.  Goto label 107 if dialog canceled.
  136. ASK 2 "Pick up the phone & dial ^1.  Hit OK when the phone rings, then hangup." 107
  137. note "Manual dialing initiated" 3
  138. ! X1 to ignore dialtone & busy, D to dial, \^ generates data tone
  139. write "ATX1D\13"
  140. jump 32
  141. !
  142. @LABEL 17
  143. note "Dialing without tone" 3
  144. matchclr
  145. matchstr 1 19 "OK\13\10"
  146. ! X1 to ignore dialtone & busy
  147. write "ATX1\13"
  148. matchread 30
  149. jump 101
  150. !
  151. !
  152. @LABEL 19
  153. ! Display the full dialstring contained in Varstring 1
  154. note "Dialing ^1" 3
  155. !
  156. ! Varstrings 7, 8 and 9, contain dialstring fragments
  157. !    Long phone numbers may need to be split into smaller groups
  158. !    for the modem to use
  159. !
  160. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  161. ! Varstring 8 == blank (dialstring in varstring 7)
  162. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  163. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  164. ! \^ is added to the dialstring to force the modem to generate a data tone
  165. ifstr 8 27 " "
  166. ifstr 9 24 " "
  167. !
  168. !  Write dialstring in varstrings 7, 8 & 9
  169. matchclr
  170. matchstr 1 21 "OK\13\10"
  171. write "ATD^3^7;\13"
  172. matchread 400
  173. jump 101
  174.  
  175. @LABEL 21
  176. matchclr
  177. matchstr 1 22 "OK\13\10"
  178. write "ATD^3^8;\13"
  179. matchread 400
  180. jump 101
  181.  
  182. @LABEL 22
  183. write "ATD^3^9\13"
  184. jump 32
  185. !
  186. !
  187. @LABEL 24
  188. !  Write dialstring in varstrings 7 & 8
  189. matchclr
  190. matchstr 1 25 "OK\13\10"
  191. write "ATD^3^7;\13"
  192. matchread 400
  193. jump 101
  194.  
  195. @LABEL 25
  196. write "ATD^3^8\13"
  197. jump 32
  198. !
  199. @LABEL 27
  200. !  Write dialstring in varstring 7
  201. write "ATD^3^7\13"
  202. !
  203. !
  204. !    ---- Connection responce ----
  205. !
  206. ! The following section will parse modem responces of two types:
  207. !   1) PROTOCOL: xxx, COMPRESSION: xxx, CONNECT xxx
  208. !   2) CONNECT xxx/ARQ/V42
  209. !
  210. @LABEL 32
  211. matchclr
  212. matchstr  1 81  "RING\13\10"
  213. matchstr  2 102 "NO DIALTONE\13\10"
  214. matchstr  3 103 "NO CARRIER"
  215. matchstr  4 103 "ERROR\13\10"
  216. matchstr  5 104 "BUSY\13\10"
  217. matchstr  6 105 "NO ANSWER\13\10"
  218. matchstr  7 33  "CONNECT "
  219. matchstr  8 32  "CARRIER"
  220. matchstr  9 40  "CONNECT\13\10"
  221. matchstr 10 62  "PROTOCOL: LAP"
  222. matchstr 11 62  "PROTOCOL: MNP"
  223. matchstr 12 62  "PROTOCOL: ALT"
  224. matchstr 13 67  "COMPRESSION: V"
  225. matchstr 14 67  "COMPRESSION: MNP5"
  226. matchstr 15 67  "COMPRESSION: CLASS"
  227. matchread 700
  228. ifANSWER 32
  229. jump 101
  230. !
  231. !  Parse the speed of connect result codes
  232. !  2400 and 4800 have two entries each
  233. !  to distinguish them from 24000 and 48000
  234. !
  235. @LABEL 33
  236. matchclr
  237. matchstr  1 40 "2400\13"
  238. matchstr  2 40 "2400/"
  239. matchstr  3 41 "4800\13"
  240. matchstr  4 41 "4800/"
  241. matchstr  5 42 "7200"
  242. matchstr  6 43 "9600"
  243. matchstr  7 44 "12000"
  244. matchstr  8 45 "14400"
  245. matchstr  9 46 "16800"
  246. matchstr 10 47 "19200"
  247. matchstr 11 48 "21600"
  248. matchstr 12 49 "24000"
  249. matchstr 13 50 "26400"
  250. matchstr 14 51 "28800"
  251. matchstr 15 52 "31200"
  252. matchstr 16 53 "33600"
  253. matchstr 17 54 "38400"
  254. matchstr 18 55 "48000"
  255. matchstr 19 56 "56000"
  256. matchstr 20 57 "57600"
  257. matchstr 21 58 "64000"
  258. matchread 30
  259. jump 59
  260. !
  261. ! -- Connection rates --
  262. ! CommunicatingAt informs ARA of the raw modem to modem
  263. ! connection speed.
  264. !
  265. @LABEL 40
  266. note "Communicating at 2400 bps." 2
  267. CommunicatingAt 2400
  268. jump 60
  269. !
  270. @LABEL 41
  271. note "Communicating at 4800 bps." 2
  272. CommunicatingAt 4800
  273. jump 60
  274. !
  275. @LABEL 42
  276. note "Communicating at 7200 bps." 2
  277. CommunicatingAt 7200
  278. jump 60
  279. !
  280. @LABEL 43
  281. note "Communicating at 9600 bps." 2
  282. CommunicatingAt 9600
  283. jump 60
  284. !
  285. @LABEL 44
  286. note "Communicating at 12400 bps." 2
  287. CommunicatingAt 12400
  288. jump 60
  289. !
  290. @LABEL 45
  291. note "Communicating at 14400 bps." 2
  292. CommunicatingAt 14400
  293. jump 60
  294. !
  295. @LABEL 46
  296. note "Communicating at 16800 bps." 2
  297. CommunicatingAt 16800
  298. jump 60
  299. !
  300. @LABEL 47
  301. note "Communicating at 19200 bps." 2
  302. CommunicatingAt 19200
  303. jump 60
  304. !
  305. @LABEL 48
  306. note "Communicating at 21600 bps." 2
  307. CommunicatingAt 21600
  308. jump 60
  309. !
  310. @LABEL 49
  311. note "Communicating at 24000 bps." 2
  312. CommunicatingAt 24000
  313. jump 60
  314. !
  315. @LABEL 50
  316. note "Communicating at 26400 bps." 2
  317. CommunicatingAt 26400
  318. jump 60
  319. !
  320. @LABEL 51
  321. note "Communicating at 28800 bps." 2
  322. CommunicatingAt 28800
  323. jump 60
  324. !
  325. @LABEL 52
  326. note "Communicating at 31200 bps." 2
  327. CommunicatingAt 31200
  328. jump 60
  329. !
  330. @LABEL 53
  331. note "Communicating at 33600 bps." 2
  332. CommunicatingAt 33600
  333. jump 60
  334. !
  335. @LABEL 54
  336. note "Communicating at 38400 bps." 2
  337. CommunicatingAt 38400
  338. jump 60
  339. !
  340. @LABEL 55
  341. note "Communicating at 48000 bps." 2
  342. CommunicatingAt 48000
  343. jump 60
  344. !
  345. @LABEL 56
  346. note "Communicating at 56000 bps." 2
  347. CommunicatingAt 56000
  348. jump 60
  349. !
  350. @LABEL 57
  351. note "Communicating at 57600 bps." 2
  352. CommunicatingAt 57600
  353. jump 60
  354. !
  355. @LABEL 58
  356. note "Communicating at 64000 bps." 2
  357. CommunicatingAt 64000
  358. jump 60
  359. !
  360. @LABEL 59
  361. note "Communicating at an unknown rate." 2
  362. jump 60
  363. !
  364. ! Look for reliablilty and compression results 
  365. ! at the end of the connect result.
  366. !
  367. @LABEL 60
  368. matchclr
  369. matchstr  1 63 "LAPM"
  370. matchstr  2 63 "REL"
  371. matchstr  3 63 "ARQ"
  372. matchstr  4 68 "COMP/"
  373. matchstr  5 68 "COMP\13"
  374. matchstr  6 63 "V42/"
  375. matchstr  7 63 "V42\13"
  376. matchstr  8 68 "V42BIS"
  377. matchstr  9 68 "V42bis"
  378. matchstr 10 63 "MNP\13"
  379. matchstr 11 68 "MNP5"
  380. matchstr 12 70 "\10"
  381. matchread 30
  382. jump 70
  383.  
  384. ! -- Modem error correction link negotiation --
  385. ! Userhook 2 informs ARA that a modem-to-modem error
  386. ! correcting protocol has been negotiated
  387. !
  388. !
  389. @LABEL 62
  390. note "Modem Reliable Link Established." 2
  391. userhook 2
  392. jump 32
  393. !
  394. @LABEL 63
  395. note "Modem Reliable Link Established." 2
  396. userhook 2
  397. jump 60
  398. !
  399. ! -- Compression negotiation --
  400. ! Userhook 3 informs ARA that a modem-to-modem compression
  401. ! protocol has been negotiated
  402. !
  403. @LABEL 67
  404. note "Modem Compression Established." 2
  405. userhook 3
  406. jump 32
  407. !
  408. @LABEL 68
  409. note "Modem Compression Established." 2
  410. userhook 3
  411. jump 60
  412. !
  413. !
  414. ! -- Normal exit after "CONNECT" --
  415. !
  416. !  This modem has been setup to do CTS handshaking,
  417. !  and we assume that a CTS handshaking cable is being used.
  418. !
  419. @LABEL 70
  420. ! Turn on CTS handshaking.
  421. HSReset 0 1 0 0 0 0
  422. !
  423. ifANSWER 71
  424. pause 30
  425. @LABEL 71
  426. exit 0
  427. !
  428. !
  429. ! ---- Answer calls ----
  430. !
  431. !    A RING result from the modem and in ANSWERING mode
  432. !    claims the serial port and answering the phone
  433. !
  434. @LABEL 81
  435. ifORIGINATE 32
  436. userhook 1
  437. note "Answering phone..." 2
  438. write "ATA\13"
  439. jump 32
  440. !
  441. !
  442. ! ---- Hang up and reset modem ----
  443. !
  444. @HANGUP
  445. @LABEL 90
  446. settries 0
  447. HSReset 0 0 0 0 0 0
  448. !
  449. @LABEL 92
  450. !  Escape from data to command mode
  451. matchclr
  452. matchstr 1 96 "OK\13\10"
  453. write "+++"
  454. matchread 20
  455. !
  456. @LABEL 94
  457. ! Force a hangup
  458. matchclr
  459. matchstr 1 98 "NO CARRIER\13\10"
  460. matchstr 2 98 "OK\13\10"
  461. matchstr 3 98 "ERROR\13\10"
  462. matchstr 4 98 "0\13\10"
  463. write "ATH\13"
  464. matchread 30
  465. ! Try to get control of the modem by toggling DTR
  466. DTRClear
  467. pause 5
  468. DTRSet
  469. flush
  470. !
  471. ! Try the hangup sequence three times otherwise declare and error
  472. inctries
  473. iftries 3 101
  474. jump 92
  475. !
  476. @LABEL 96
  477. ! Pause between data and command mode
  478. pause 50
  479. jump 94
  480. !
  481. !
  482. @LABEL 98
  483. ! Recall the factory settings
  484. pause 15
  485. matchclr
  486. matchstr 1 99 "OK\13\10"
  487. write "AT&F\13"
  488. matchread 30
  489. jump 101
  490. !
  491. @LABEL 99
  492. exit 0
  493. !
  494. ! ---- Error messages -----
  495. !
  496. ! Modem Not Responding
  497. @LABEL 101
  498. exit -6019
  499. !
  500. ! No Dial Tone
  501. @LABEL 102
  502. exit -6020
  503. !
  504. ! No Carrier or Error
  505. @LABEL 103
  506. exit -6021
  507. !
  508. ! Busy
  509. @LABEL 104
  510. exit -6022
  511. !
  512. ! No Answer
  513. @LABEL 105
  514. exit -6023
  515. !
  516. ! User Cancellation
  517. @LABEL 107
  518. exit -6008
  519.